package com.ecoolex.union.pay.retailer.enums;

import com.ecoolex.framework.common.EnumInterface;
import com.ecoolex.framework.common.util.Check;

public enum UnionPayCouponStatus implements EnumInterface<UnionPayCouponStatus, Integer> {

    UNUSED(1, "未使用"),LOCKED(2, "已锁定"), USED(3, "已使用"), EXPIRED(4, "已过期"), INVALID(5, "作废");


    private final int real;

    private final String describe;

    UnionPayCouponStatus(int real, String describe) {
        this.real = real;
        this.describe = describe;
    }
    @Override
    public Integer real() {
        return this.real;
    }

    @Override
    public String describe() {
        return this.describe;
    }

    @Override
    public UnionPayCouponStatus realOf(Integer real) {
        if (Check.notNull(real)) {
            for (UnionPayCouponStatus v : values()) {
                if (v.real().equals(real)) {
                    return v;
                }
            }
        }
        return null;
    }
}
